/*
 * ietDoLib.h
 *
 *  Created on: 2025 08 01
 *      Author: 刘宏伟
 */

#ifndef SRC_IETDOLIB_H_
#define SRC_IETDOLIB_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "global.h"

/********************************************************/

struct DomParam
{
    int timeOutEnable;  //超时使能
    int timeOut;        //秒级超时配置
};

struct PulseParam
{
    int number;         //脉冲个数 
    int pulsewidth;     //脉冲宽度-高电平时间   
    int pulseInterval;  //脉冲周期   -孟确认
    int reserve1;       //备用
    int reserve2;       //备用
    int reserve3;       //备用
};

/********************************************************
                  DO控制接口定义
*********************************************************/
int DOMOpen(int moduleType);

int DOMInit(int channel, struct DomParam doParam);

int DOMWrite(int channel, unsigned char data);

int DOMWriteAll(unsigned int data);

int DOMPulseWrite(int channel, struct PulseParam pulseParam);

int DOMRead(int channel, unsigned int *data);

int DOMClose();

int DOMGetDrvVer();

int DOMGetFpgaVer();

int DOMGetLibVer();

#ifdef __cplusplus
}
#endif
#endif /* SRC_IETDOLIB_H_ */
